<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>遍历对象属性和值的方法</title>
  </head>
  <body>
    <ul>
      <li></li>
    </ul>
    <ul>
      <li></li>
      <li></li>
      <li></li>
    </ul>
    <button></button>
    <button></button>
    <button></button>
  </body>
  <script>
    const hd = {
      name: "houdunren",
      age: 23
    };
    console.log(Object.keys(hd));
    console.log(Object.values(hd));
    console.log(JSON.stringify(Object.entries(hd), null, 2));

    for (const [key, value] of Object.entries(hd)) {
      console.log(key, value);
    }
  </script>
</html>
